package com.xrit.mapper;

import com.github.pagehelper.Page;
import com.xrit.pojo.SetMeal;
import com.xrit.pojo.SetMealExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SetMealMapper {

    //热门套餐:前四条
    List<Map<String, Object>> findHotSetmeal();

    /**
     * 获取套餐的预约数量
     * @return
     */
    List<Map<String, Object>> findSetmealCount();

    //5.根据id查询套餐详情,包括检查组和检查项信息
    SetMeal queryDetailsById(Integer id);

    //4.删除检查组和检查项第三方表数据
    void deleteMealAndGroupByMealId(Integer id);

    //3.根据套餐id查询第三方表中检查组的ids
    List<Integer> queryCheckGroupByMealId(Integer mealId);

    //2.添加套餐和检查组的关系
    void addSetMealCheckGroup(@Param("mealId")Integer mealId, @Param("groupIds") Integer[] groupIds);

    //1.条件查询
    Page<SetMeal> selectByQueryString(String queryString);

    long countByExample(SetMealExample example);

    int deleteByExample(SetMealExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(SetMeal record);

    int insertSelective(SetMeal record);

    List<SetMeal> selectByExample(SetMealExample example);

    SetMeal selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") SetMeal record, @Param("example") SetMealExample example);

    int updateByExample(@Param("record") SetMeal record, @Param("example") SetMealExample example);

    int updateByPrimaryKeySelective(SetMeal record);

    int updateByPrimaryKey(SetMeal record);


}
